{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 10,
   "metadata": {},
   "outputs": [],
   "source": [
    "import os\n",
    "#coding=utf8\n",
    "import sys\n",
    "import string\n",
    "from urllib.request import Request, urlopen\n",
    "from urllib.error import HTTPError\n",
    "from bs4 import BeautifulSoup\n",
    "import time\n",
    "import datetime\n",
    "import ssl\n",
    "import numpy as np\n",
    "import pandas as pd\n",
    "import traceback\n",
    "import csv\n",
    "ssl._create_default_https_context = ssl._create_unverified_context\n",
    "import json"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 18,
   "metadata": {},
   "outputs": [],
   "source": [
    "j = json.loads()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 24,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "'8edf8defcaa101a2a8b278a7c2951bb06b706f1b'"
      ]
     },
     "execution_count": 24,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "j[\"parents\"][0][\"sha\"]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 15,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "{'name': 'windows_usb.c',\n",
       " 'path': 'third_party/libusb/src/libusb/os/windows_usb.c',\n",
       " 'sha': '48ea08ca1058c5b70f519f6a6e7d867f10acfea8',\n",
       " 'size': 116873,\n",
       " 'url': 'https://api.github.com/repos/chromium/chromium/contents/third_party/libusb/src/libusb/os/windows_usb.c?ref=ac149a8d4371c0e01e0934fdd57b09e86f96b5b9',\n",
       " 'html_url': 'https://github.com/chromium/chromium/blob/ac149a8d4371c0e01e0934fdd57b09e86f96b5b9/third_party/libusb/src/libusb/os/windows_usb.c',\n",
       " 'git_url': 'https://api.github.com/repos/chromium/chromium/git/blobs/48ea08ca1058c5b70f519f6a6e7d867f10acfea8',\n",
       " 'download_url': 'https://raw.githubusercontent.com/chromium/chromium/ac149a8d4371c0e01e0934fdd57b09e86f96b5b9/third_party/libusb/src/libusb/os/windows_usb.c',\n",
       " 'type': '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BpX2JhY2tlbmRbVVNCX0FQSV9XSU5VU0JY\\nXS5yZXNldF9kZXZpY2UoaSwgZGV2X2hhbmRsZSk7CgkJCWlmIChyICE9IExJ\\nQlVTQl9TVUNDRVNTKSB7CgkJCQlyZXR1cm4gcjsKCQkJfQoJCX0KCX0KCXJl\\ndHVybiBMSUJVU0JfU1VDQ0VTUzsKfQoKc3RhdGljIGludCBjb21wb3NpdGVf\\nY29weV90cmFuc2Zlcl9kYXRhKGludCBzdWJfYXBpLCBzdHJ1Y3QgdXNiaV90\\ncmFuc2ZlciAqaXRyYW5zZmVyLCB1aW50MzJfdCBpb19zaXplKQp7CglzdHJ1\\nY3QgbGlidXNiX3RyYW5zZmVyICp0cmFuc2ZlciA9IFVTQklfVFJBTlNGRVJf\\nVE9fTElCVVNCX1RSQU5TRkVSKGl0cmFuc2Zlcik7CglzdHJ1Y3Qgd2luZG93\\nc190cmFuc2Zlcl9wcml2ICp0cmFuc2Zlcl9wcml2ID0gdXNiaV90cmFuc2Zl\\ncl9nZXRfb3NfcHJpdihpdHJhbnNmZXIpOwoJc3RydWN0IHdpbmRvd3NfZGV2\\naWNlX3ByaXYgKnByaXYgPSBfZGV2aWNlX3ByaXYodHJhbnNmZXItPmRldl9o\\nYW5kbGUtPmRldik7CgoJcmV0dXJuIHByaXYtPnVzYl9pbnRlcmZhY2VbdHJh\\nbnNmZXJfcHJpdi0+aW50ZXJmYWNlX251bWJlcl0uYXBpYi0+CgkJY29weV90\\ncmFuc2Zlcl9kYXRhKHByaXYtPnVzYl9pbnRlcmZhY2VbdHJhbnNmZXJfcHJp\\ndi0+aW50ZXJmYWNlX251bWJlcl0uc3ViX2FwaSwgaXRyYW5zZmVyLCBpb19z\\naXplKTsKfQo=\\n',\n",
       " 'encoding': 'base64',\n",
       " '_links': {'self': 'https://api.github.com/repos/chromium/chromium/contents/third_party/libusb/src/libusb/os/windows_usb.c?ref=ac149a8d4371c0e01e0934fdd57b09e86f96b5b9',\n",
       "  'git': 'https://api.github.com/repos/chromium/chromium/git/blobs/48ea08ca1058c5b70f519f6a6e7d867f10acfea8',\n",
       "  'html': 'https://github.com/chromium/chromium/blob/ac149a8d4371c0e01e0934fdd57b09e86f96b5b9/third_party/libusb/src/libusb/os/windows_usb.c'}}"
      ]
     },
     "execution_count": 15,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "j"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 26,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "{\"sha\": \"fbacc95f38366fb040026ac47b7c645e51a3bb9f\", \"filename\": \"third_party/WebKit/Tools/ChangeLog\", \"status\": \"modified\", \"additions\": 15, \"deletions\": 0, \"changes\": 15, \"blob_url\": \"https://github.com/chromium/chromium/blob/b7a161633fd7ecb59093c2c56ed908416292d778/third_party/WebKit/Tools/ChangeLog\", \"raw_url\": \"https://github.com/chromium/chromium/raw/b7a161633fd7ecb59093c2c56ed908416292d778/third_party/WebKit/Tools/ChangeLog\", \"contents_url\": \"https://api.github.com/repos/chromium/chromium/contents/third_party/WebKit/Tools/ChangeLog?ref=b7a161633fd7ecb59093c2c56ed908416292d778\", \"patch\": \"@@ -1,3 +1,18 @@\\n+2012-11-21  Zan Dobersek  <zandobersek@gmail.com>\\n+\\n+        [GTK][WTR] Implement AccessibilityUIElement::stringValue\\n+        https://bugs.webkit.org/show_bug.cgi?id=102951\\n+\\n+        Reviewed by Martin Robinson.\\n+\\n+        Implement AccessibilityUIElement::stringValue in the ATK backend\\n+        in the same manner it is implemented in DumpRenderTree.\\n+\\n+        * WebKitTestRunner/InjectedBundle/atk/AccessibilityUIElementAtk.cpp:\\n+        (WTR::replaceCharactersForResults):\\n+        (WTR):\\n+        (WTR::AccessibilityUIElement::stringValue):\\n+\\n 2012-11-21  Vineet Chaudhary  <rgf748@motorola.com>\\n \\n         Unreviewed. Adding myself to committers.py.\"}\n",
      "{\"sha\": \"0bfe9ac96fce9bf767d6b33991ac8d47726740ab\", \"filename\": \"third_party/WebKit/Tools/WebKitTestRunner/InjectedBundle/atk/AccessibilityUIElementAtk.cpp\", \"status\": \"modified\", \"additions\": 27, \"deletions\": 2, \"changes\": 29, \"blob_url\": \"https://github.com/chromium/chromium/blob/b7a161633fd7ecb59093c2c56ed908416292d778/third_party/WebKit/Tools/WebKitTestRunner/InjectedBundle/atk/AccessibilityUIElementAtk.cpp\", \"raw_url\": \"https://github.com/chromium/chromium/raw/b7a161633fd7ecb59093c2c56ed908416292d778/third_party/WebKit/Tools/WebKitTestRunner/InjectedBundle/atk/AccessibilityUIElementAtk.cpp\", \"contents_url\": \"https://api.github.com/repos/chromium/chromium/contents/third_party/WebKit/Tools/WebKitTestRunner/InjectedBundle/atk/AccessibilityUIElementAtk.cpp?ref=b7a161633fd7ecb59093c2c56ed908416292d778\", \"patch\": \"@@ -35,6 +35,9 @@\\n #include <wtf/Assertions.h>\\n #include <wtf/gobject/GOwnPtr.h>\\n #include <wtf/gobject/GRefPtr.h>\\n+#include <wtf/text/CString.h>\\n+#include <wtf/text/WTFString.h>\\n+#include <wtf/unicode/CharacterNames.h>\\n \\n namespace WTR {\\n \\n@@ -121,6 +124,22 @@ static void alterCurrentValue(PlatformUIElement element, int factor)\\n     g_value_unset(&currentValue);\\n }\\n \\n+static gchar* replaceCharactersForResults(gchar* str)\\n+{\\n+    WTF::String uString = WTF::String::fromUTF8(str);\\n+\\n+    // The object replacement character is passed along to ATs so we need to be\\n+    // able to test for their presence and do so without causing test failures.\\n+    uString.replace(objectReplacementCharacter, \\\"<obj>\\\");\\n+\\n+    // The presence of newline characters in accessible text of a single object\\n+    // is appropriate, but it makes test results (especially the accessible tree)\\n+    // harder to read.\\n+    uString.replace(\\\"\\\\n\\\", \\\"<\\\\\\\\n>\\\");\\n+\\n+    return g_strdup(uString.utf8().data());\\n+}\\n+\\n AccessibilityUIElement::AccessibilityUIElement(PlatformUIElement element)\\n     : m_element(element)\\n {\\n@@ -406,8 +425,14 @@ JSRetainPtr<JSStringRef> AccessibilityUIElement::orientation() const\\n \\n JSRetainPtr<JSStringRef> AccessibilityUIElement::stringValue()\\n {\\n-    // FIXME: implement\\n-    return JSStringCreateWithCharacters(0, 0);\\n+    if (!m_element || !ATK_IS_TEXT(m_element))\\n+        return JSStringCreateWithCharacters(0, 0);\\n+\\n+    GOwnPtr<gchar> text(atk_text_get_text(ATK_TEXT(m_element), 0, -1));\\n+    GOwnPtr<gchar> textWithReplacedCharacters(replaceCharactersForResults(text.get()));\\n+    GOwnPtr<gchar> axValue(g_strdup_printf(\\\"AXValue: %s\\\", textWithReplacedCharacters.get()));\\n+\\n+    return JSStringCreateWithUTF8CString(axValue.get());\\n }\\n \\n JSRetainPtr<JSStringRef> AccessibilityUIElement::language()\"}\n"
     ]
    }
   ],
   "source": [
    "for i in j[\"files\"]:\n",
    "    print(json.dumps(i))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 54,
   "metadata": {},
   "outputs": [],
   "source": [
    "def get_response(url):\n",
    "    return json.loads(urlopen(Request(url,headers={'User-Agent': 'Mozilla/5.0'})).read())"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 55,
   "metadata": {},
   "outputs": [],
   "source": [
    "url = \"https://api.github.com/repos/torvalds/linux/commits/f2815633504b442ca0b0605c16bf3d88a3a0fcea\"\n",
    "response = get_response(url)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 65,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "[{'sha': 'de1a0138317f482c028ce583c335501b14d9f917',\n",
       "  'filename': 'net/sctp/sm_statefuns.c',\n",
       "  'status': 'modified',\n",
       "  'additions': 1,\n",
       "  'deletions': 1,\n",
       "  'changes': 2,\n",
       "  'blob_url': 'https://github.com/torvalds/linux/blob/f2815633504b442ca0b0605c16bf3d88a3a0fcea/net/sctp/sm_statefuns.c',\n",
       "  'raw_url': 'https://github.com/torvalds/linux/raw/f2815633504b442ca0b0605c16bf3d88a3a0fcea/net/sctp/sm_statefuns.c',\n",
       "  'contents_url': 'https://api.github.com/repos/torvalds/linux/contents/net/sctp/sm_statefuns.c?ref=f2815633504b442ca0b0605c16bf3d88a3a0fcea',\n",
       "  'patch': '@@ -2082,7 +2082,7 @@ sctp_disposition_t sctp_sf_do_5_2_4_dupcook(struct net *net,\\n \\t}\\n \\n \\t/* Delete the tempory new association. */\\n-\\tsctp_add_cmd_sf(commands, SCTP_CMD_NEW_ASOC, SCTP_ASOC(new_asoc));\\n+\\tsctp_add_cmd_sf(commands, SCTP_CMD_SET_ASOC, SCTP_ASOC(new_asoc));\\n \\tsctp_add_cmd_sf(commands, SCTP_CMD_DELETE_TCB, SCTP_NULL());\\n \\n \\t/* Restore association pointer to provide SCTP command interpeter'}]"
      ]
     },
     "execution_count": 65,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "response[\"files\"]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 64,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "{'sha': 'de1a0138317f482c028ce583c335501b14d9f917',\n",
       " 'filename': 'net/sctp/sm_statefuns.c',\n",
       " 'status': 'modified',\n",
       " 'additions': 1,\n",
       " 'deletions': 1,\n",
       " 'changes': 2,\n",
       " 'blob_url': 'https://github.com/torvalds/linux/blob/f2815633504b442ca0b0605c16bf3d88a3a0fcea/net/sctp/sm_statefuns.c',\n",
       " 'raw_url': 'https://github.com/torvalds/linux/raw/f2815633504b442ca0b0605c16bf3d88a3a0fcea/net/sctp/sm_statefuns.c',\n",
       " 'contents_url': 'https://api.github.com/repos/torvalds/linux/contents/net/sctp/sm_statefuns.c?ref=f2815633504b442ca0b0605c16bf3d88a3a0fcea',\n",
       " 'patch': '@@ -2082,7 +2082,7 @@ sctp_disposition_t sctp_sf_do_5_2_4_dupcook(struct net *net,\\n \\t}\\n \\n \\t/* Delete the tempory new association. */\\n-\\tsctp_add_cmd_sf(commands, SCTP_CMD_NEW_ASOC, SCTP_ASOC(new_asoc));\\n+\\tsctp_add_cmd_sf(commands, SCTP_CMD_SET_ASOC, SCTP_ASOC(new_asoc));\\n \\tsctp_add_cmd_sf(commands, SCTP_CMD_DELETE_TCB, SCTP_NULL());\\n \\n \\t/* Restore association pointer to provide SCTP command interpeter'}"
      ]
     },
     "execution_count": 64,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "response[\"files\"][0]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 76,
   "metadata": {},
   "outputs": [],
   "source": [
    "sss = '{\"sha\": \"de1a0138317f482c028ce583c335501b14d9f917\", \"filename\": \"net/sctp/sm_statefuns.c\", \"status\": \"modified\", \"additions\": 1, \"deletions\": 1, \"changes\": 2, \"blob_url\": \"https://github.com/torvalds/linux/blob/f2815633504b442ca0b0605c16bf3d88a3a0fcea/net/sctp/sm_statefuns.c\", \"raw_url\": \"https://github.com/torvalds/linux/raw/f2815633504b442ca0b0605c16bf3d88a3a0fcea/net/sctp/sm_statefuns.c\", \"contents_url\": \"https://api.github.com/repos/torvalds/linux/contents/net/sctp/sm_statefuns.c?ref=f2815633504b442ca0b0605c16bf3d88a3a0fcea\", \"patch\": \"@@ -2082,7 +2082,7 @@ sctp_disposition_t sctp_sf_do_5_2_4_dupcook(struct net *net,\\\\n \\\\t}\\\\n \\\\n \\\\t/* Delete the tempory new association. */\\\\n-\\\\tsctp_add_cmd_sf(commands, SCTP_CMD_NEW_ASOC, SCTP_ASOC(new_asoc));\\\\n+\\\\tsctp_add_cmd_sf(commands, SCTP_CMD_SET_ASOC, SCTP_ASOC(new_asoc));\\\\n \\\\tsctp_add_cmd_sf(commands, SCTP_CMD_DELETE_TCB, SCTP_NULL());\\\\n \\\\n \\\\t/* Restore association pointer to provide SCTP command interpeter\"}'+\"<_**next**_>\"+'{\"sha\": \"de1a0138317f482c028ce583c335501b14d9f917\", \"filename\": \"net/sctp/sm_statefuns.c\", \"status\": \"modified\", \"additions\": 1, \"deletions\": 1, \"changes\": 2, \"blob_url\": \"https://github.com/torvalds/linux/blob/f2815633504b442ca0b0605c16bf3d88a3a0fcea/net/sctp/sm_statefuns.c\", \"raw_url\": \"https://github.com/torvalds/linux/raw/f2815633504b442ca0b0605c16bf3d88a3a0fcea/net/sctp/sm_statefuns.c\", \"contents_url\": \"https://api.github.com/repos/torvalds/linux/contents/net/sctp/sm_statefuns.c?ref=f2815633504b442ca0b0605c16bf3d88a3a0fcea\", \"patch\": \"@@ -2082,7 +2082,7 @@ sctp_disposition_t sctp_sf_do_5_2_4_dupcook(struct net *net,\\\\n \\\\t}\\\\n \\\\n \\\\t/* Delete the tempory new association. */\\\\n-\\\\tsctp_add_cmd_sf(commands, SCTP_CMD_NEW_ASOC, SCTP_ASOC(new_asoc));\\\\n+\\\\tsctp_add_cmd_sf(commands, SCTP_CMD_SET_ASOC, SCTP_ASOC(new_asoc));\\\\n \\\\tsctp_add_cmd_sf(commands, SCTP_CMD_DELETE_TCB, SCTP_NULL());\\\\n \\\\n \\\\t/* Restore association pointer to provide SCTP command interpeter\"}'"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 80,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "de1a0138317f482c028ce583c335501b14d9f917\n",
      "de1a0138317f482c028ce583c335501b14d9f917\n"
     ]
    }
   ],
   "source": [
    "for i in sss.split(\"<_**next**_>\"):\n",
    "    print(json.loads(i)[\"sha\"])"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 60,
   "metadata": {},
   "outputs": [],
   "source": [
    "files_changed = \"\"\n",
    "i= 0\n",
    "for s in sss:\n",
    "    if i <len(sss)-1:\n",
    "        files_changed = str(files_changed)+str(s)+\",\"\n",
    "    else:\n",
    "        files_changed = str(files_changed)+str(s)\n",
    "    i+=1\n",
    "files_changed = \"{\"+ files_changed +\"}\""
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 61,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "'{{\"sha\": \"de1a0138317f482c028ce583c335501b14d9f917\", \"filename\": \"net/sctp/sm_statefuns.c\", \"status\": \"modified\", \"additions\": 1, \"deletions\": 1, \"changes\": 2, \"blob_url\": \"https://github.com/torvalds/linux/blob/f2815633504b442ca0b0605c16bf3d88a3a0fcea/net/sctp/sm_statefuns.c\", \"raw_url\": \"https://github.com/torvalds/linux/raw/f2815633504b442ca0b0605c16bf3d88a3a0fcea/net/sctp/sm_statefuns.c\", \"contents_url\": \"https://api.github.com/repos/torvalds/linux/contents/net/sctp/sm_statefuns.c?ref=f2815633504b442ca0b0605c16bf3d88a3a0fcea\", \"patch\": \"@@ -2082,7 +2082,7 @@ sctp_disposition_t sctp_sf_do_5_2_4_dupcook(struct net *net,\\\\n \\\\t}\\\\n \\\\n \\\\t/* Delete the tempory new association. */\\\\n-\\\\tsctp_add_cmd_sf(commands, SCTP_CMD_NEW_ASOC, SCTP_ASOC(new_asoc));\\\\n+\\\\tsctp_add_cmd_sf(commands, SCTP_CMD_SET_ASOC, SCTP_ASOC(new_asoc));\\\\n \\\\tsctp_add_cmd_sf(commands, SCTP_CMD_DELETE_TCB, SCTP_NULL());\\\\n \\\\n \\\\t/* Restore association pointer to provide SCTP command interpeter\"},{\"sha\": \"de1a0138317f482c028ce583c335501b14d9f917\", \"filename\": \"net/sctp/sm_statefuns.c\", \"status\": \"modified\", \"additions\": 1, \"deletions\": 1, \"changes\": 2, \"blob_url\": \"https://github.com/torvalds/linux/blob/f2815633504b442ca0b0605c16bf3d88a3a0fcea/net/sctp/sm_statefuns.c\", \"raw_url\": \"https://github.com/torvalds/linux/raw/f2815633504b442ca0b0605c16bf3d88a3a0fcea/net/sctp/sm_statefuns.c\", \"contents_url\": \"https://api.github.com/repos/torvalds/linux/contents/net/sctp/sm_statefuns.c?ref=f2815633504b442ca0b0605c16bf3d88a3a0fcea\", \"patch\": \"@@ -2082,7 +2082,7 @@ sctp_disposition_t sctp_sf_do_5_2_4_dupcook(struct net *net,\\\\n \\\\t}\\\\n \\\\n \\\\t/* Delete the tempory new association. */\\\\n-\\\\tsctp_add_cmd_sf(commands, SCTP_CMD_NEW_ASOC, SCTP_ASOC(new_asoc));\\\\n+\\\\tsctp_add_cmd_sf(commands, SCTP_CMD_SET_ASOC, SCTP_ASOC(new_asoc));\\\\n \\\\tsctp_add_cmd_sf(commands, SCTP_CMD_DELETE_TCB, SCTP_NULL());\\\\n \\\\n \\\\t/* Restore association pointer to provide SCTP command interpeter\"}}'"
      ]
     },
     "execution_count": 61,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "files_changed"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 63,
   "metadata": {},
   "outputs": [
    {
     "ename": "JSONDecodeError",
     "evalue": "Expecting property name enclosed in double quotes: line 1 column 2 (char 1)",
     "output_type": "error",
     "traceback": [
      "\u001b[0;31m---------------------------------------------------------------------------\u001b[0m",
      "\u001b[0;31mJSONDecodeError\u001b[0m                           Traceback (most recent call last)",
      "\u001b[0;32m<ipython-input-63-23930432958a>\u001b[0m in \u001b[0;36m<module>\u001b[0;34m\u001b[0m\n\u001b[0;32m----> 1\u001b[0;31m \u001b[0mj\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mjson\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mloads\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m'{{\"sha\": \"de1a0138317f482c028ce583c335501b14d9f917\", \"filename\": \"net/sctp/sm_statefuns.c\", \"status\": \"modified\", \"additions\": 1, \"deletions\": 1, \"changes\": 2, \"blob_url\": \"https://github.com/torvalds/linux/blob/f2815633504b442ca0b0605c16bf3d88a3a0fcea/net/sctp/sm_statefuns.c\", \"raw_url\": \"https://github.com/torvalds/linux/raw/f2815633504b442ca0b0605c16bf3d88a3a0fcea/net/sctp/sm_statefuns.c\", \"contents_url\": \"https://api.github.com/repos/torvalds/linux/contents/net/sctp/sm_statefuns.c?ref=f2815633504b442ca0b0605c16bf3d88a3a0fcea\", \"patch\": \"@@ -2082,7 +2082,7 @@ sctp_disposition_t sctp_sf_do_5_2_4_dupcook(struct net *net,\\\\n \\\\t}\\\\n \\\\n \\\\t/* Delete the tempory new association. */\\\\n-\\\\tsctp_add_cmd_sf(commands, SCTP_CMD_NEW_ASOC, SCTP_ASOC(new_asoc));\\\\n+\\\\tsctp_add_cmd_sf(commands, SCTP_CMD_SET_ASOC, SCTP_ASOC(new_asoc));\\\\n \\\\tsctp_add_cmd_sf(commands, SCTP_CMD_DELETE_TCB, SCTP_NULL());\\\\n \\\\n \\\\t/* Restore association pointer to provide SCTP command interpeter\"},{\"sha\": \"de1a0138317f482c028ce583c335501b14d9f917\", \"filename\": \"net/sctp/sm_statefuns.c\", \"status\": \"modified\", \"additions\": 1, \"deletions\": 1, \"changes\": 2, \"blob_url\": \"https://github.com/torvalds/linux/blob/f2815633504b442ca0b0605c16bf3d88a3a0fcea/net/sctp/sm_statefuns.c\", \"raw_url\": \"https://github.com/torvalds/linux/raw/f2815633504b442ca0b0605c16bf3d88a3a0fcea/net/sctp/sm_statefuns.c\", \"contents_url\": \"https://api.github.com/repos/torvalds/linux/contents/net/sctp/sm_statefuns.c?ref=f2815633504b442ca0b0605c16bf3d88a3a0fcea\", \"patch\": \"@@ -2082,7 +2082,7 @@ sctp_disposition_t sctp_sf_do_5_2_4_dupcook(struct net *net,\\\\n \\\\t}\\\\n \\\\n \\\\t/* Delete the tempory new association. */\\\\n-\\\\tsctp_add_cmd_sf(commands, SCTP_CMD_NEW_ASOC, SCTP_ASOC(new_asoc));\\\\n+\\\\tsctp_add_cmd_sf(commands, SCTP_CMD_SET_ASOC, SCTP_ASOC(new_asoc));\\\\n \\\\tsctp_add_cmd_sf(commands, SCTP_CMD_DELETE_TCB, SCTP_NULL());\\\\n \\\\n \\\\t/* Restore association pointer to provide SCTP command interpeter\"}}'\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m",
      "\u001b[0;32m/usr/local/Cellar/python/3.7.4/Frameworks/Python.framework/Versions/3.7/lib/python3.7/json/__init__.py\u001b[0m in \u001b[0;36mloads\u001b[0;34m(s, encoding, cls, object_hook, parse_float, parse_int, parse_constant, object_pairs_hook, **kw)\u001b[0m\n\u001b[1;32m    346\u001b[0m             \u001b[0mparse_int\u001b[0m \u001b[0;32mis\u001b[0m \u001b[0;32mNone\u001b[0m \u001b[0;32mand\u001b[0m \u001b[0mparse_float\u001b[0m \u001b[0;32mis\u001b[0m \u001b[0;32mNone\u001b[0m \u001b[0;32mand\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m    347\u001b[0m             parse_constant is None and object_pairs_hook is None and not kw):\n\u001b[0;32m--> 348\u001b[0;31m         \u001b[0;32mreturn\u001b[0m \u001b[0m_default_decoder\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mdecode\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0ms\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m    349\u001b[0m     \u001b[0;32mif\u001b[0m \u001b[0mcls\u001b[0m \u001b[0;32mis\u001b[0m \u001b[0;32mNone\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m    350\u001b[0m         \u001b[0mcls\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mJSONDecoder\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n",
      "\u001b[0;32m/usr/local/Cellar/python/3.7.4/Frameworks/Python.framework/Versions/3.7/lib/python3.7/json/decoder.py\u001b[0m in \u001b[0;36mdecode\u001b[0;34m(self, s, _w)\u001b[0m\n\u001b[1;32m    335\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m    336\u001b[0m         \"\"\"\n\u001b[0;32m--> 337\u001b[0;31m         \u001b[0mobj\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mend\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mraw_decode\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0ms\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0midx\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0m_w\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0ms\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0;36m0\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mend\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m    338\u001b[0m         \u001b[0mend\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0m_w\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0ms\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mend\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mend\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m    339\u001b[0m         \u001b[0;32mif\u001b[0m \u001b[0mend\u001b[0m \u001b[0;34m!=\u001b[0m \u001b[0mlen\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0ms\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n",
      "\u001b[0;32m/usr/local/Cellar/python/3.7.4/Frameworks/Python.framework/Versions/3.7/lib/python3.7/json/decoder.py\u001b[0m in \u001b[0;36mraw_decode\u001b[0;34m(self, s, idx)\u001b[0m\n\u001b[1;32m    351\u001b[0m         \"\"\"\n\u001b[1;32m    352\u001b[0m         \u001b[0;32mtry\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m--> 353\u001b[0;31m             \u001b[0mobj\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mend\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mscan_once\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0ms\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0midx\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m    354\u001b[0m         \u001b[0;32mexcept\u001b[0m \u001b[0mStopIteration\u001b[0m \u001b[0;32mas\u001b[0m \u001b[0merr\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m    355\u001b[0m             \u001b[0;32mraise\u001b[0m \u001b[0mJSONDecodeError\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m\"Expecting value\"\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0ms\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0merr\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mvalue\u001b[0m\u001b[0;34m)\u001b[0m \u001b[0;32mfrom\u001b[0m \u001b[0;32mNone\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n",
      "\u001b[0;31mJSONDecodeError\u001b[0m: Expecting property name enclosed in double quotes: line 1 column 2 (char 1)"
     ]
    }
   ],
   "source": [
    "j = json.loads('{{\"sha\": \"de1a0138317f482c028ce583c335501b14d9f917\", \"filename\": \"net/sctp/sm_statefuns.c\", \"status\": \"modified\", \"additions\": 1, \"deletions\": 1, \"changes\": 2, \"blob_url\": \"https://github.com/torvalds/linux/blob/f2815633504b442ca0b0605c16bf3d88a3a0fcea/net/sctp/sm_statefuns.c\", \"raw_url\": \"https://github.com/torvalds/linux/raw/f2815633504b442ca0b0605c16bf3d88a3a0fcea/net/sctp/sm_statefuns.c\", \"contents_url\": \"https://api.github.com/repos/torvalds/linux/contents/net/sctp/sm_statefuns.c?ref=f2815633504b442ca0b0605c16bf3d88a3a0fcea\", \"patch\": \"@@ -2082,7 +2082,7 @@ sctp_disposition_t sctp_sf_do_5_2_4_dupcook(struct net *net,\\\\n \\\\t}\\\\n \\\\n \\\\t/* Delete the tempory new association. */\\\\n-\\\\tsctp_add_cmd_sf(commands, SCTP_CMD_NEW_ASOC, SCTP_ASOC(new_asoc));\\\\n+\\\\tsctp_add_cmd_sf(commands, SCTP_CMD_SET_ASOC, SCTP_ASOC(new_asoc));\\\\n \\\\tsctp_add_cmd_sf(commands, SCTP_CMD_DELETE_TCB, SCTP_NULL());\\\\n \\\\n \\\\t/* Restore association pointer to provide SCTP command interpeter\"},{\"sha\": \"de1a0138317f482c028ce583c335501b14d9f917\", \"filename\": \"net/sctp/sm_statefuns.c\", \"status\": \"modified\", \"additions\": 1, \"deletions\": 1, \"changes\": 2, \"blob_url\": \"https://github.com/torvalds/linux/blob/f2815633504b442ca0b0605c16bf3d88a3a0fcea/net/sctp/sm_statefuns.c\", \"raw_url\": \"https://github.com/torvalds/linux/raw/f2815633504b442ca0b0605c16bf3d88a3a0fcea/net/sctp/sm_statefuns.c\", \"contents_url\": \"https://api.github.com/repos/torvalds/linux/contents/net/sctp/sm_statefuns.c?ref=f2815633504b442ca0b0605c16bf3d88a3a0fcea\", \"patch\": \"@@ -2082,7 +2082,7 @@ sctp_disposition_t sctp_sf_do_5_2_4_dupcook(struct net *net,\\\\n \\\\t}\\\\n \\\\n \\\\t/* Delete the tempory new association. */\\\\n-\\\\tsctp_add_cmd_sf(commands, SCTP_CMD_NEW_ASOC, SCTP_ASOC(new_asoc));\\\\n+\\\\tsctp_add_cmd_sf(commands, SCTP_CMD_SET_ASOC, SCTP_ASOC(new_asoc));\\\\n \\\\tsctp_add_cmd_sf(commands, SCTP_CMD_DELETE_TCB, SCTP_NULL());\\\\n \\\\n \\\\t/* Restore association pointer to provide SCTP command interpeter\"}}')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.7.4"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
